package com.sunb2b.entity;

import java.util.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.sunb2b.util.JsonUtils;

/**
 * Category entity. @author MyEclipse Persistence Tools
 */

public class Category {

	// Fields

	private String id;
	private String parentId;//for insert purpose only
	@NotEmpty
	private String name;
	private String description;
	private String listTemplate;
	private String detailTemplate;
	private String productEditor;
	private String listPath;
	private String detailPath;
	private Set categoryAttrs = new HashSet(0);
	
	public String toJsonString(){
		Map jsonMap = new HashMap();
		jsonMap.put("id", id);
		jsonMap.put("parentId", parentId);
		jsonMap.put("name", name);
		jsonMap.put("description", description);
		jsonMap.put("listTemplate", listTemplate);
		jsonMap.put("detailTemplate", detailTemplate);
		jsonMap.put("productEditor", productEditor);
		jsonMap.put("listPath", listPath);
		jsonMap.put("detailPath", detailPath);
		return JsonUtils.map2json(jsonMap);
	}

	// Constructors

	/** default constructor */
	public Category() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getListTemplate() {
		return listTemplate;
	}

	public void setListTemplate(String listTemplate) {
		this.listTemplate = listTemplate;
	}

	public String getDetailTemplate() {
		return detailTemplate;
	}

	public void setDetailTemplate(String detailTemplate) {
		this.detailTemplate = detailTemplate;
	}

	public String getProductEditor() {
		return productEditor;
	}

	public void setProductEditor(String productEditor) {
		this.productEditor = productEditor;
	}

	public String getListPath() {
		return listPath;
	}

	public void setListPath(String listPath) {
		this.listPath = listPath;
	}

	public String getDetailPath() {
		return detailPath;
	}

	public void setDetailPath(String detailPath) {
		this.detailPath = detailPath;
	}

	public Set getCategoryAttrs() {
		return categoryAttrs;
	}

	public void setCategoryAttrs(Set categoryAttrs) {
		this.categoryAttrs = categoryAttrs;
	}
	
}